<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form name="form1">
        <h2>form1</h2>
        <p>
            name <input type="text" name="username">
        </p>
        <p>
            email <input type="text" name="email">
        </p>
        <p>
            <button name="submit" id="btn">提交</button>
        </p>
    </form>
    <script>
        console.log(document.form1);
        console.log(document.form1.username);
        console.log(document.form1.email);
        console.log(document.form1.submit);
        console.log(document.getElementById('btn'));
        console.log(document.getElementById('btn').form);
        console.log(document.form1.email.form);

    </script>
</body>

</html>